package de.gwtprime.client.event;

import com.google.gwt.event.shared.GwtEvent;

import de.gwtprime.client.event.handler.AnswerCompleteVotedHandler;
import de.gwtprime.shared.requestFactory.AnswerProxy;

public class AnswerCompleteVoted extends GwtEvent<AnswerCompleteVotedHandler>{
	
	public static Type<AnswerCompleteVotedHandler> TYPE = new Type<AnswerCompleteVotedHandler>(); 
	
	private AnswerProxy answer;
	
	public AnswerCompleteVoted(AnswerProxy answer) {
		this.setAnswer(answer);
	}

	@Override
	protected void dispatch(AnswerCompleteVotedHandler handler) {
		handler.onVoteAdded(this);
	}

	@Override
	public Type<AnswerCompleteVotedHandler> getAssociatedType() {
		return TYPE;
	}

	public AnswerProxy getAnswer() {
		return answer;
	}

	public void setAnswer(AnswerProxy answer) {
		this.answer = answer;
	}


}
